package com.sikaryofficial.system.mapper;

import com.sikaryofficial.system.api.model.ManualExportReq;
import com.sikaryofficial.system.api.model.user.UserDailyDTO;
import com.sikaryofficial.system.domain.SysUserDaily;
import com.sikaryofficial.system.domain.dto.TrendDTO;
import com.sikaryofficial.system.domain.dto.TrendReq;
import com.sikaryofficial.system.domain.vo.ReportTrendVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 用户日活Mapper接口
 *
 * @author qinjinyuan
 * @date 2024-04-07
 */
public interface SysUserDailyMapper {
    void batchInsert(@Param("list") List<SysUserDaily> list);

    List<TrendDTO> getDailyByDate(@Param("req") TrendReq req);

    Long countDailyByDate(@Param("req") TrendReq req);

    int saveOrUpdateYearly(@Param("genDate") Date genDate, @Param("brand") String brand, @Param("subTotal") Long subTotal
            ,@Param("hasLogin") Integer hasLogin);

    int saveOrUpdateQuarterly(@Param("quarterNum") Integer quarterNum, @Param("brand") String brand, @Param("subTotal") Long subTotal
            ,@Param("hasLogin") Integer hasLogin);

    int saveOrUpdateMonthly(@Param("genDate") Date genDate, @Param("brand") String brand, @Param("subTotal") Long subTotal
            ,@Param("hasLogin") Integer hasLogin);

    int saveOrUpdateWeekly(@Param("weekNum") Integer weekNum, @Param("brand") String brand, @Param("subTotal") Long subTotal
            ,@Param("hasLogin") Integer hasLogin);

    int saveOrUpdateDaily(@Param("genDate") Date genDate, @Param("brand") String brand, @Param("subTotal") Long subTotal,
                          @Param("objectId") String objectId,@Param("hasLogin") Integer hasLogin);

    List<ReportTrendVO> queryWeekly(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

    List<ReportTrendVO> queryMonthly(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

    List<ReportTrendVO> queryQuarterly(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

    List<ReportTrendVO> queryYearly(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

    List<UserDailyDTO> queryDailyByTime(@Param("req") ManualExportReq req);
}
